package com.example.shardingspheredemo.model.t.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.shardingspheredemo.model.t.entity.UserEntity;
import com.example.shardingspheredemo.model.t.mapper.UserMapper;
import com.example.shardingspheredemo.model.t.service.UserService;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author Andrew Yang
 * @className UserServiceImpl
 * @description
 * @package com.example.shardingspheredemo.model.t.service.impl
 * @create 2020-09-04 15:17
 */
@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> implements UserService {

    @Override
    public  List<UserEntity> getList() {
//        return this.list();
        return baseMapper.getUserList();
    }

    @Override
    public String insertForeach(List<UserEntity> userList) {
        //批量插入数据
        baseMapper.insertForeach(userList);
        return "保存成功";
    }

}
